Skip to content

[6.x] Elements service#18660

Merged
brandonkelly merged 69 commits into6.xfrom
feature/elements-service
Apr 7, 2026
Merged

[6.x] Elements service#18660
brandonkelly merged 69 commits into6.xfrom
feature/elements-service

Conversation

@riasvdv
Copy link
Copy Markdown
Contributor

@riasvdv riasvdv commented Apr 1, 2026

Introduction

Ports the remainder of the Elements service.

Other public services that have been extracted before from Elements:

Operations

The Elements service itself has been split up as well to be a public service that forwards to the following Operation services:

  • ElementCanonicalChanges
  • ElementDeletions
  • ElementDuplicates
  • ElementEagerLoader
  • ElementPlaceholders
  • ElementRefs
  • ElementUris
  • ElementWrites

These services are marked as @internal - meaning they should only be used within the Element namespace, the Elements service in particular.

There is also no Facade created for any of these services as they really are meant to only be called by the Elements service.

This split allows us to have classes that are maintainable and tests that are separated by the concerns while still having one general service to interact with them.

Authorization

All authorization methods have not been ported over. These are now handled directly by using Laravel's Gate or $user->can() through the ElementPolicy.

The legacy service registers a before callback that fires the legacy authorization events.

Base automatically changed from feature/element-activity to 6.x April 1, 2026 15:38
@riasvdv riasvdv requested a review from brandonkelly April 3, 2026 10:05
@brandonkelly brandonkelly merged commit eee7d0c into 6.x Apr 7, 2026
16 checks passed
@brandonkelly brandonkelly deleted the feature/elements-service branch April 7, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants